﻿using FluentValidation;
using RockBus.DataContracts;

namespace RockBus.ConfigurationService.Validation
{
    internal class ReceivePortInfoValidator : AbstractValidator<ReceivePortInfo>
    {
        public ReceivePortInfoValidator()
        {
            this.RuleFor(x => x.Detail).NotNull();
            this.RuleFor(x => x.Detail).SetValidator(new ReceivePortDetailValidator());
            //this.RuleFor(x => x.FilterIds).NotNull().WithMessage("At least one FilterId must be specified.");
            //this.RuleFor(x => x.FilterIds).NotEmpty().WithMessage("At least one FilterId must be specified.");
        }
    }

    public class ReceivePortDetailValidator : AbstractValidator<ReceivePortDetail>
    {
        public ReceivePortDetailValidator()
        {
            this.RuleFor(x => x.Id).NotNull();
            this.RuleFor(x => x.Id).NotEmpty();
        }
    }
}